<script language="javascript" src="<?php echo $this->baseUrl('application/js/jquery-ui.js'); ?>"></script>
<script>
$(function() {
    $( "#start_date" ).datepicker({
        dateFormat:"dd/mm/yy",
    });
});
</script>
<div class="widget">
    <h3>Tìm kiếm tour du lịch</h3>
    <div  class="destination-selection box clearfix">
        <div id="advSearchForm">
            <form id="advSearch"  method="get" action="<?php echo $this->baseUrl('tour/search'); ?>">
                <div style="clear:both">
                <table class="table_search">
                    <tr>
                        <td style="width: 100px;"><label for="start_place">Nơi bắt đầu</label></td>
                        <td>
                            <select name="start_place" class="input_search" id="start_place">
                            <?php
                                $place = new Default_Model_Place();
                                $listPlace = $place->listPlace();
                                foreach($listPlace as $value) :
        						$levelCss = '';
        			            if($value['level'] == 0){
        			            	$name = $value['place_name'];
        			            }else if($value['level'] == 1){
        			            	$name = ' + ' . $value['place_name'];
        			            }else{
        			            	$name = ' - - ' . $value['place_name'];
        			            	$levelCss =  'padding-left: ' . (10 * $value['level']) . 'px;';
        			            }
        		            ?>
        					<option value="<?php echo $value['place_id']; ?>" style="<?php echo $levelCss; ?>"><?php echo $name; ?></option>
        					<?php endforeach; ?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><label for="finish_place">Nơi kết thúc</label></td>
                        <td>
                            <select name="finish_place" class="input_search" id="finish_place">
                            <?php
                                foreach($listPlace as $value) :
        						$levelCss = '';
        			            if($value['level'] == 0){
        			            	$name = $value['place_name'];
        			            }else if($value['level'] == 1){
        			            	$name = ' + ' . $value['place_name'];
        			            }else{
        			            	$name = ' - - ' . $value['place_name'];
        			            	$levelCss =  'padding-left: ' . (10 * $value['level']) . 'px;';
        			            }
        		            ?>
        					<option value="<?php echo $value['place_id']; ?>" style="<?php echo $levelCss; ?>"><?php echo $name; ?></option>
        					<?php endforeach; ?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td><label for="start_date">Ngày khởi hành</label></td>
                        <td><input type="text" name="start_date" class="input_search" id="start_date"/></td>
                    </tr>
                    <tr>
                        <td><label for="price">Mức giá</label></td>
                        <td>
                            <select name="price" class="input_search" id="price">
                            <option value="0">Dưới 2 triệu</option>
                            <option value="1">2 đến 4 triệu</option>
                            <option value="2">4 đến 6 triệu</option>
                            <option value="3">6 đến 8 triệu</option>
                            <option value="4">8 đến 10 triệu </option>
                            <option value="5">10 đến 13 triệu</option>
                            <option value="6">13 đến 16 triệu</option>
                            <option value="7">16 đến 20 triệu</option>
                            <option value="8">Trên 20 triệu</option>
                        </select>
                        </td>
                    </tr>
                </table>
                </div>
                <div style="clear:both"></div>
                <div class="searchsub">
                    <input class="search-btn" type="submit" value="Search" name="submit"/>
                </div>
            </form>
        </div>
    </div>
</div>